<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
        <button @click="list.splice(1, 0, { id: 44, name: '赵六' })">添加元素到下标1</button>
        <ul>
            <!-- 
                没key的时候是就地复用，只要类型一样就按顺序就地复用
                有key的时候，就按照key来复用，也就是复用的时候会找key值一样的来复用
             -->
            <li v-for="(item, index) in list" :key="item.id"> <input type="text"> {{ item.name }}</li>
        </ul>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: '#app',
        data () {
          return {
            list: [
              { id: 60, name: '张三' },
              { id: 55, name: '李四' },
              { id: 32, name: '王五' }
            ]
          }
        },
        methods: {}
      })
    </script>
  </body>
</html>
